#include "CMyGameDef.h"
#include "GameGlobal.h"

int GameGlobal::m_nCurrStage;
int GameGlobal::m_nPlayerLife;
int GameGlobal::m_nScore;
int GameGlobal::m_nHiScore;
int GameGlobal::m_nPlayerBulletLevel;
bool GameGlobal::m_bBgMusic;
bool GameGlobal::m_bEffSound;
bool GameGlobal::m_bVibrate;
int GameGlobal::m_nEnemyKill[4];

void GameGlobal::init(int type)
{
	if (type == GAME_GLOBAL_GAMEDATA)
	{
		m_nCurrStage = 0;
		m_nPlayerLife = DEF_PLAYER_LIFE;
		m_nScore = 0;
		m_nHiScore = 0;
		m_nPlayerBulletLevel = PLAYER_BULLET_LEV_DEF;
	}
	else if (type == GAME_GLOBAL_OPTION)
	{
		m_bBgMusic = true;
		m_bEffSound = true;
		m_bVibrate = true;
	}
	else if (type == GAME_GLOBAL_STAGE_INFO)
	{
		for (int i = 0; i < 4; i++)
			m_nEnemyKill[i] = 0;
	}
	else
	{
		// game data
		m_nCurrStage = 0;
		m_nPlayerLife = DEF_PLAYER_LIFE;
		m_nScore = 0;
		m_nHiScore = 0;
		m_nPlayerBulletLevel = PLAYER_BULLET_LEV_DEF;
		// option
		m_bBgMusic = true;
		m_bEffSound = true;
		m_bVibrate = true;
		// stage info
		for (int i = 0; i < 4; i++)
			m_nEnemyKill[i] = 0;
	}
}
